from selenium.webdriver.common.by import By

byid = By.ID
byname = By.NAME
bycname = By.CLASS_NAME
bytname = By.TAG_NAME
bylink = By.LINK_TEXT
bycss = By.CSS_SELECTOR
byxpath = By.XPATH
byparriallike = By.PARTIAL_LINK_TEXT

url = "http://10.59.9.8:7007/boss/"

# 添加菜单
class Add_menu:
    # 点击权限管理
    power_manage = byxpath,'/html/body/div[1]/div[2]/div[2]/div[2]/div[1]/h2'
    # 点击菜单管理
    menu_manage = byxpath,'//*[@id="sidebar"]/div[2]/div[2]/ul/li[1]/div/a'
    # 点击添加
    add_btn = byid,'addMenu'
    # 输入菜单名称
    menu_name = byxpath,'//*[@id="form"]/div[1]/p[2]/input'
    # 输入菜单编号
    menu_num = byxpath,'//*[@id="form"]/div[1]/p[3]/input'
    # 输入请求URL
    request_url = byxpath,'//*[@id="form"]/div[1]/p[4]/input'
    # 输入navTabId
    navtab = byxpath,'//*[@id="form"]/div[1]/p[5]/input'
    # 点击保存
    save_btn = byxpath,'//*[@id="form"]/div[2]/ul/li[1]/div/div'
    # 断言1
    dy1 = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div/div/div[2]/div/div[2]/ul/li[1]/div/a'
    # 断言2
    dy2 = byxpath,'/html/body/div[16]/div[1]/div/div/h1'

add_pe = Add_menu()

# 添加权限
class Add_power:
    # 点击权限管理
    power_manage = byxpath,'/html/body/div[1]/div[2]/div[2]/div[2]/div[1]/h2'
    # 点击权限管理2
    power_manage2 = byxpath,'//*[@id="sidebar"]/div[2]/div[2]/ul/li[2]/div/a'
    # 点击添加权限
    add_power_btn = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[3]/div[2]/div[1]/ul/li/a'
    # 输入权限名称
    power_name = byxpath,'/html/body/div[16]/div[2]/div/form/div[1]/p[1]/input'
    # 输入权限标识
    power_num = byxpath,'//*[@id="form1"]/div[1]/p[2]/input'
    # 输入权限描述
    power_desc = byxpath,'//*[@id="form1"]/div[1]/p[4]/textarea'
    # 点击保存
    save_btn = byxpath,'//*[@id="form1"]/div[2]/ul/li[1]/div/div'

power_pe = Add_power()

# 查询权限
class Select_power:
    # 点击权限管理
    power_manage = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[1]/h2'
    # 点击权限管理2
    power_manage2 = byxpath, '//*[@id="sidebar"]/div[2]/div[2]/ul/li[2]/div/a'
    # 输入权限名称
    power_name = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[1]/input'
    # 点击查询按钮
    query_bth = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[1]/form/div/table/tbody/tr/td[3]/div/ul/li/div/div'
    # 断言1
    dy = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[2]/div'
    # 断言2
    dy2 = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[1]/div/table/thead/tr/th[2]/div'

select_pe = Select_power()

# 添加角色
class Add_role:
    # 点击权限管理
    power_manage = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[1]/h2'
    # 点击角色管理
    role_manage = byxpath,'/html/body/div[1]/div[2]/div[2]/div[2]/div[2]/ul/li[3]/div/a'
    # 添加角色
    add_role = byxpath,'//a[@class="add" and contains(., "添加角色")]'
    # 输入角色名称
    role_name = byname,'roleName'
    # 输入角色编码
    role_number = byxpath,'/html/body/div[16]/div[2]/div/form/div[1]/p[2]/input'
    # 输入角色描述
    role_desc = byxpath,'/html/body/div[16]/div[2]/div/form/div[1]/p[3]/textarea'
    # 点击保存
    save_btn = byxpath,'/html/body/div[16]/div[2]/div/form/div[2]/ul/li[1]/div/div'

role = Add_role()

# 查询角色
class Select_role:
    # 点击权限管理
    power_manage = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[1]/h2'
    # 点击角色管理
    role_manage = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[2]/ul/li[3]/div/a'
    # 点击输入框
    # input_click = byxpath,'//*[@id="roleName_4846"]'
    # 输入角色名称
    role_name = byid,'roleName_4846'
    # 点击查询
    select_btn = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[3]/div[1]/form/div/table/tbody/tr/td[2]/div/ul/li/div'
    # 断言
    dy = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[3]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[2]/div'


query_role = Select_role()

# 上架支付产品业务
class Add_product_grounding:
    # 点击支付管理
    pay_manage = byxpath,'/html/body/div[1]/div[2]/div[2]/div[2]/div[7]'
    # 点击支付产品信息
    pay_product_msg = byxpath,'//*[@id="sidebar"]/div[2]/div[8]/ul/li[1]/div/a'
    # 点击添加支付产品
    add_pay_product = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[1]/ul/li[1]/a/span'
    # 输入产品编码
    product_number = byxpath,'//*[@id="navTab"]/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[1]/dd/input'
    # 输入产品名称
    product_name = byxpath,'//*[@id="navTab"]/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input'
    # 点击提交
    submit_btn = byxpath,'//*[@id="navTab"]/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div/button'
    # 设置支付方式
    set_pay = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[6]/div/a[1]'
    # 点击设置支付方式
    set_pay_btn = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[3]/div[2]/div[1]/ul/li[1]/a'
    # 支付方式
    select_pay_way = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[4]/div/form/div[1]/div/fieldset/dl[1]/dd/select'
    value1 = "WEIXIN"
    # 支付类型
    select_pay_type = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[4]/div/form/div[1]/div/fieldset/dl[2]/dd/select'
    value2 = "SCANPAY"
    # 输入支付费率
    pay_money = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[4]/div/form/div[1]/div/fieldset/dl[3]/dd/input'
    # 点击提交2
    submit2_btn = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[4]/div/form/div[2]/ul/li[1]/div/div'
    # 点击上架
    grounding = byxpath,'/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[6]/div/a[2]'
    # 断言
    dy = byxpath,'//*[@id="navTab"]/div[2]/div[2]/div[2]/div[2]/div[1]/div/table/thead/tr/th[3]/div'


product = Add_product_grounding()


# 发起结算打款成功
class Recnooadd:
    # 结算管理
    recnoo_jsgl = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[11]/h2'
    # 结算记录管理
    recnoo_jsjl = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[12]/ul/li/div/a'
    # 发起结算按钮
    recnoo_fqjsbtn = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[1]/ul/li[1]'
    # 搜索图标
    recnoo_sstb = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[1]/dd/a'
    # 选择用户名
    recnoo_xz = byxpath, '/html/body/div[13]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[2]/td[7]/div/a'
    # 获取可结算余额
    recnoo_hqkjsye = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[3]/dd/a'
    # 结算余额
    recnoo_jsye = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[4]/dd/input'
    # 提交按钮
    recnoo_tjbtn = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div'
    # 审核
    recnoo_sh = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[10]/div/a[2]'
    # 审核备注
    recnoo_shbz = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input'
    # 审核提交按钮
    recnoo_shbtn = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div'
    # 打款
    recnoo_dk = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[10]/div/a[2]'
    # 打款备注
    recnoo_dkbz = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[1]/div/fieldset/dl[2]/dd/input'
    # 打款提交按钮
    recnoo_dkbtn = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[3]/div/form/div[2]/ul/li[1]/div/div/button'
    # 断言
    recnoo_dy = byxpath, '/html/body/div[1]/div[3]/div/div[2]/div[2]/div[2]/div[2]/div[2]/div/table/tbody/tr[1]/td[8]/div'

recnoo = Recnooadd()
